package chapter08_oop._enum;

/**
 * ClassName: SeasonTest1
 * Package: chapter._enum
 * Description:
 *
 * 枚举类的创建-->jdk5.0及之后
 *
 * @Author SherryAn
 * @Create 2025/7/22 19:24
 */
class SeasonTest1{
    public static void main(String[] args) {
        System.out.println(Season.spring);
        System.out.println(Season.winter.getSeasonName());
    }
}
enum Season1 {
//    1.必须在枚举类开头声明多个对象，对象之间使用,隔开
    SPRING ("春天","春"),
    summer ("夏天","春"),
    autumn("秋天","春"),
    winter("冬天","春");
//    2.声明当前类的对象的实例变量，使用private final修饰
    private final String seasonName;
    private final String seasonDesc;
//    3.私有化构造器
    private Season1(String seasonName,String seasonDesc){
        this.seasonName=seasonName;
        this.seasonDesc=seasonDesc;


}
//    4.提供实例变量的get方法

    public String getSeasonName() {
        return seasonName;
    }

    public String getSeasonDesc() {
        return seasonDesc;
    }
}